package com.acme.bankapp.domain.bank;

public abstract class AbstractAccount implements Account{

	protected int id;
	protected double balance;

	public AbstractAccount(final double amount) {
		this.balance = amount;
	}
	
	@Override
	public double getBalance() {
		return balance;
	}
	
	@Override
	public void deposit(final double amount){
		this.balance = this.balance + amount;
		System.out.println(" succsessful. Your balance now: "+this.balance);
	}
	
	@Override
	public void withdraw(final double amount){
		if (this.balance >= amount) {
			this.balance = this.balance - amount;				
		}
	}
}
